<?php
/**
 * Created by PhpStorm.
 * User: bevan
 * Date: 2018/1/6
 * Time: 下午1:42
 */

namespace app\admin\validate;

use think\Validate;

class MenuValidate extends Validate
{
    protected $rule = [
        'name' => 'require',
        'app' => 'require',
        'controller' => 'require',
        'action' => 'require',
        'parent_id' => 'require|number|min:0',
    ];

    protected $message = [
        'name.require' => '请输入菜单名',
        'app.require' => '请输入菜单对应的模块',
        'controller.require' => '请输入菜单对应的控制器',
        'action.require' => '请输入菜单对应的方法',
        'parent_id.require' => '父级id不能为空',
        'parent_id.number' => '父级id必须是数字',
        'parent_id.min' => '最小父级id不能小于0'
    ];
}